#include <stdio.h>

#define N 60
#define M 10

int main(int argc, char const *argv[])
{
    /*
//斐波那契
    long long  a[N]={0};
    for (int i = 1; i <= N; i++)
    {
        if(i<2)
        {
            a[i]=1;
        }
        else
        {
            a[i] = a[i-1]+a[i-2];
        }
        printf("第%d个月的兔子数量为:%lld亿 \n",i,a[i]/10000/10000);
    }
 

    int a[3][4]={0};
   
    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            printf("请输入a[%d][%d]=",i,j);
            scanf("%d",&a[i][j]);
        }
        
    }
    printf("数组内容>:\n");
    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            printf("%2d ",a[i][j]);
        }
        printf("\n");
    }
*/
//杨辉三角型
    int a[M][M]={0};
    int t;

    for (int i = 0; i < M; i++)
    {
        for (int j = 0; j < M-1-i; j++)
        {
            printf("  ");
        }
        
        for (int j = 0; j <= i; j++)
        {
            if((j==0) || (i==j))
            {
                a[i][0]=a[i][j]=1;
            }

            else
            {
                a[i][j]=a[i-1][j-1]+a[i-1][j];
            }
                
        printf("%3d ",a[i][j]);     
            
        }
        printf("\n");
    }
    

    return 0;
}
